﻿<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="sec" uri="http://www.springframework.org/security/tags"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%> 
<%@ taglib prefix="d" uri="/WEB-INF/resource.tld" %>

<fmt:setBundle basename="ApplicationMessage" />
<fmt:setLocale value="zh_CN" />

<!DOCTYPE html>
<html lang="zh-CN">
<head>

  <%@ include file="/WEB-INF/include/meta.jsp"%>
  <%@ include file="/WEB-INF/include/css.jsp"%>
  
</head>

<body>

  <%@ include file="/WEB-INF/include/header.jsp"%>
  
  <%@ include file="/WEB-INF/include/menu.jsp"%>
  
  <div class="container main-content">

    <div class="panel panel-default x-panel x-panel-layout">

      <div class="panel-heading">
        <ol class="breadcrumb">
          <li><a href="${ctx.host}/individual-rounds">课程管理</a></li>
          <li class="active">课件管理</li>
          <li class="no-before pull-right" style="min-width: 65px;">
            <a onclick="window.history.back();"><i class="glyphicon glyphicon-arrow-left"></i>&nbsp;&nbsp;返回</a>
          </li>
        </ol>
      </div>

      <div class="panel-body">

        <div class="col-xs-2 x-panel-layout-left no-horizontal-padding">
          <%@ include file="/WEB-INF/include/submenu.jsp"%>
        </div>

        <div class="col-xs-10 x-panel-layout-right">

          <div class="x-breadcrumb-wrapper">
            <div class="x-breadcrumb clearfix">
              <h2><i class="glyphicon glyphicon-fire" title="分组模板详情"></i>&nbsp;&nbsp;<span>课程排期&nbsp;-&nbsp;周计划</span></h2>
              <div class="pull-right">
                <a href="${ctx.host}/individual-rounds/${roundId}/print?generated=false" class="btn btn-success x-btn btn-shadow btn-shadow-success ">打印课件</a>
                <a href="${ctx.host}/individual-rounds/${roundId}/print?generated=true" class="btn btn-success x-btn btn-shadow btn-shadow-success ">打印已发送课件</a>
              </div>
            </div>
          </div>
          
          <div class="x-breadcrumb-wrapper top-margin-20" style="position: relative; margin-top:20px;" >
            <ul class="nav nav-pills x-breadcrumb-nav">
                <li class="pull-left"><a href="${ctx.host}/individual-rounds/${roundId}">基本信息</a></li>
                <li class="pull-left active"><a href="${ctx.host}/individual-rounds/${roundId}/batch-coursewares/weekly-plan/1">周计划</a></li>
                <li class="pull-left"><a href="${ctx.host}/individual-rounds/${roundId}/batch-coursewares/1?type=course">课程</a></li>
                <c:if test="${!batchCourseware.courseRound.courseStatus.prepare}">
                  <li class="pull-left"><a href="${ctx.host}/individual-rounds/${roundId}/physical-data">身体数据</a></li>
                </c:if>
                <li class="pull-left"><a href="${ctx.host}/individual-rounds/${roundId}/basic-information">学员基础信息</a></li>
                <c:if test="${not empty resultReport}">
                <li class="pull-left"><a href="${ctx.host}/individual-rounds/${roundId}/result-report">成果报告</a></li>
                </c:if>
                <div class=" pull-right courseware-btn">
                  <c:if test="${!batchCourseware.editStatus.generated and not currentPrincipal.coursewareMonitor}">
                    <!-- <a href="${ctx.host}/individual-rounds/${roundId}/batch-coursewares/${batchCourseware.id}/link?type=${type}" data-target="#offline-link" data-toggle="modal">发送课件</a> -->
                  </c:if>
                  <%-- <c:if test="${batchCourseware.editStatus.prepare}">
                    <a href="${ctx.host}/individual-rounds/${roundId}/batch-coursewares/${batchCourseware.id}/save-all" data-target="#save-all" data-toggle="modal">全部保存</a>
                  </c:if> --%>
                  <c:if test="${not empty batchCourseware.courseRound.student.tagIds and not currentPrincipal.coursewareMonitor}">
                    <a href="${ctx.host}/individual-rounds/${roundId}/batch-coursewares/${batchCourseware.id}/edit-tags" data-target="#edit-tags" data-toggle="modal">修改标签</a>
                  </c:if>
                </div>
            </ul>
          </div>
          
          <div class="clearfix">
          
          <div class="row" >
          
            <div class="col-xs-2 template-submenu" >
              <ul class="nav nav-pills nav-stacked template-list">
                <c:forEach var="batch" items="${persist.batchCourseware(roundId, 'weekly')}">
                  <li class="submenu text-center ${weeks == batch.sorting ? 'active' : ''}"><a href="${ctx.host}/individual-rounds/${roundId}/batch-coursewares/weekly-plan/${batch.sorting}?status=${status}" >${batch.name}</a></li>
                </c:forEach>
              </ul>
            </div>
          
            <div class="col-xs-5">
              <div class="diet-layout" style="margin-left:25px;">
                <div class="row">
                  <label>运动计划:</label>
                </div>
                <div class="row">
                  <label>家庭作业（频率保证一周${exercise.homeworkFrequency}次）</label>
                </div>
                <div class="row" style="margin-right:10px;">
                  <p>LISS低强度恒速有氧训练：&nbsp;&nbsp;${exercise.liss}</p>
                </div>
                <div class="row" style="margin-right:10px;">
                  <p>HIT高强度间歇训练：&nbsp;&nbsp;${exercise.hit}</p>
                </div>
                <div class="row" style="margin-right:10px;">
                  <p>核心训练：&nbsp;&nbsp;${exercise.core}</p>
                </div>
                <div class="row" style="margin-right:10px;">
                  <p>教练备注：&nbsp;&nbsp;${exercise.remark}</p>
                </div>
                
                <div class="row">
                  <label>门店训练（频率保证一周${exercise.scheduleFrequency}次）</label>
                </div>
                <c:forEach var="schedule" items="${schedules}">
                  <div class="row" style="margin-right:10px;">
                    <p>day ${schedule.day}：&nbsp;&nbsp;<c:forEach var="content" items="${schedule.contentList}">${content.description},</c:forEach></p>
                  </div>
                </c:forEach>
              </div>
            </div>
            <div class="col-xs-5">
              <div class="diet-layout" style="margin-left:25px;">
                <div class="row">
                  <label>饮食计划:</label>
                </div>
                <div class="row" style="margin-right:10px;">
                  <p>早餐：&nbsp;&nbsp;${dietary.breakfastTemplate.name}</p>
                  <p>描述：&nbsp;&nbsp;${dietary.breakfastDescription}</p>
                </div>
                <div class="row" style="margin-right:10px;">
                  <p>午餐：&nbsp;&nbsp;${dietary.lunchTemplate.name}</p>
                  <p>描述：&nbsp;&nbsp;${dietary.lunchDescription}</p>
                </div>
                <div class="row" style="margin-right:10px;">
                  <p>晚餐：&nbsp;&nbsp;${dietary.dinnerTemplate.name}</p>
                  <p>描述：&nbsp;&nbsp;${dietary.dinnerDescription}</p>
                </div>
                <div class="row" style="margin-right:10px;">
                  <p>早餐加餐：&nbsp;&nbsp;${dietary.breakfastSnackTemplate.name}</p>
                  <p>描述：&nbsp;&nbsp;${dietary.breakfastSnackDescription}</p>
                </div>
                <div class="row" style="margin-right:10px;">
                  <p>午餐加餐：&nbsp;&nbsp;${dietary.lunchSnackTemplate.name}</p>
                  <p>描述：&nbsp;&nbsp;${dietary.lunchSnackDescription}</p>
                </div>
                <div class="row" style="margin-right:10px;">
                  <p>晚餐加餐：&nbsp;&nbsp;${dietary.dinnerSnackTemplate.name}</p>
                  <p>描述：&nbsp;&nbsp;${dietary.dinnerSnackDescription}</p>
                </div>
                
                <div class="row" style="margin-right:10px;">
                  <p>饮水量：&nbsp;&nbsp;${dietary.waterIntake}</p>
                  <p>备注：&nbsp;&nbsp;${dietary.remark}</p>
                </div>
              </div>
              
                
              <div class="diet-layout" style="margin-left:25px;">
                <label>Tips:</label>
                <p>${batchCourseware.coachTips}</p>
              </div>
                
            </div>
            
          </div>
          </div>
          
        </div>
          
        </div>

      </div>

    </div>

  <%@ include file="/WEB-INF/include/script.jsp"%>
  <d:resource root="${ctx.resource}/build" type="script" src="js/page/course/batch-courseware.js">
    <script type="text/javascript">
      require(['page/course/batch-courseware'], function(page) {
        page.init({
            "roundId": "${roundId}",
            "roundCode": "${roundCode}",
            "batchId": "${batchCourseware.id}",
            "type": 'individual'
        })
      })
    </script>
  </d:resource>
  
</body>

</html>
